﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using SmartSiteManagementSystem.AdminWeb.Extensions;
using SmartSiteManagementSystem.AdminWeb.Models;
using SmartSiteManagementSystem.IServices;
using SmartSiteManagementSystem.Models.Admin;
using Microsoft.Extensions.Logging;
using Microsoft.AspNetCore.Mvc;
using SmartSiteManagementSystem.AdminWeb.Filter;
using SmartSiteManagementSystem.AdminWeb.Common;

namespace SmartSiteManagementSystem.AdminWeb.ViewComponents
{
	
	public class AdminIndexTop: ViewComponent
    {
		private readonly ILogger<AdminIndexTop> _logger;
		//注入后台服务
		private readonly IAdminService _adminService;
		public AdminIndexTop(IAdminService adminService, ILogger<AdminIndexTop> logger)
		{
			_logger = logger;
			_adminService = adminService;
		}

		public IViewComponentResult Invoke()
		{
			AdminUserInfo AdminObj = HttpContext.Session.Get<AdminUserInfo>(SessionCookieKeyHelper.SessionKey);
			ViewBag.AdminUserObj = AdminObj;
			return View();
		}
	}
}
